﻿
#region Header
// ------------------------ Licence / Copyright ------------------------
// 
// ScrumTable for Scrum Meeting Support
// Copyright © HSR - Hochschule für Technik Rapperswil
// All Rights Reserved
// 
// Author:
//  Michael Gfeller Silvan Gehrig Patrick Boos
// 
// ---------------------------------------------------------------------
#endregion

#region Usings

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Xml.Serialization;
using ScrumTable.Common.Collections;
using Size = ScrumTable.Common.Collections.Size;

#endregion


namespace ScrumTable.Config.ConfigManagement
{
    /// <summary>
    /// Represents the configuration data object for the scrum table
    /// configuration settings.
    /// </summary>      
    [Serializable] 
    public class Config 
    {
        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------
       
        #endregion

        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------

        /// <summary>
        /// Gets or sets the Config Name
        /// </summary>
        [XmlAttribute]
        public string ConfigName { get; set; }

        /// <summary>
        /// Gets or sets the id of this config
        /// </summary>
        [XmlAttribute]
        public int Id { get; set; }
        
        /// <summary>
        /// Gets or sets a value indicating whether the chart images are
        /// visible or not.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if the charts are hidden; otherwise, <c>false</c>.
        /// </value>
        [XmlAttribute]
        public bool IsHiddenChart { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the description text and
        /// the clock of the daily scrum screen are hidden.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if the text and the clock are hidden; otherwise, <c>false</c>.
        /// </value>
        [XmlAttribute]
        public bool IsHiddenDailyScrum { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the stack rank is ascending or descending
        /// </summary>
        /// <value>
        /// 	<c>true</c> if the stack rank is descanding; otherwise ascending, <c>false</c>.
        /// </value>
        [XmlAttribute]
        public bool IsStackRankDescending { get; set; }


        /// <summary>
        /// Gets or sets a value indicating whether a bug can be a user story
        /// </summary>
        /// <value>
        /// 	<c>true</c> if bug can be a user story; otherwise not.
        /// </value>
        [XmlAttribute]
        public bool IsBugUserStory { get; set; }


        /// <summary>
        /// Gets or sets a value indicating whether the context by a drag and drop is visible
        /// </summary>
        /// <value>
        /// 	<c>true</c> if the context menu is hidden.
        /// </value>
        [XmlAttribute]
        public bool IsContextMenuHide { get; set; }


        /// <summary>
        /// Gets or sets a value indicating whether a bug is show on the task/story board
        /// On the story boards only if the bug is also a user story
        /// </summary>
        [XmlAttribute]
        public bool ShowBugInStoryAndTaskBoard { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the scrum map is customized for a customer.
        /// </summary>
        /// <value><c>true</c> if the scrum is is customized; otherwise, <c>false</c>.</value>
        [XmlAttribute]
        public bool ShowCustomScrumMap { get; set; }


        /// <summary>
        /// Gets or sets a value indicating whether the multiscreen mode is enabled.
        /// </summary>
        /// <value><c>true</c> if multiscreen mode is enabled; otherwise, <c>false</c>.</value>
        [XmlAttribute]
        public bool MultiScreenModeEnabled { get; set; }


        /// <summary>
        /// Gets or sets a value indicating whether resize button are shown on the resizable objecets
        /// </summary>
        /// <value><c>true</c> if resizable button are shown; otherwise, <c>false</c>.</value>
        [XmlAttribute]
        public bool ShowResizeButton { get; set; }


        /// <summary>
        /// Gets or sets the point marker for the project planning touch area in the custom scrum map.
        /// </summary>
        [XmlElement]
        public Point MarkerProjectPlanning { get; set; }

        /// <summary>
        /// Gets or sets the point marker for the sprint planning touch area in the custom scrum map.
        /// </summary>
        [XmlElement]
        public Point MarkerSprintPlanning { get; set; }

        /// <summary>
        /// Gets or sets the point marker for the scrum poker touch area in the custom scrum map.
        /// </summary>
        [XmlElement]
        public Point MarkerScrumPoker { get; set; }

        /// <summary>
        /// Gets or sets the point marker for the daily scrum touch area in the custom scrum map.
        /// </summary>
        [XmlElement]
        public Point MarkerDailyScrum { get; set; }

        /// <summary>
        /// Gets or sets the point marker for the review touch area in the custom scrum map.
        /// </summary>
        [XmlElement]
        public Point MarkerReview { get; set; }

        /// <summary>
        /// Gets or sets the min/max range of the could range
        /// </summary>
        [XmlElement]
        public Range RankingCould { get; set; }

        /// <summary>
        /// Gets or sets the min/max range of the should range
        /// </summary>
        [XmlElement]
        public Range RankingShould { get; set; }

        /// <summary>
        /// Gets or sets the min/max range of the must range
        /// </summary>
        [XmlElement]
        public Range RankingMust { get; set; }

        /// <summary>
        /// Gets or sets the height/width of a normal scrum item control
        /// </summary>
        public Size ControlSize { get; set; }

        
        /// <summary>
        /// Stores the screen setting, change this value only via gui
        /// </summary>
        [XmlArray("ScreenSettings")]
        [XmlArrayItem(Type = typeof(ScreenConfig), ElementName = "ScreenSetting")]
        public List<ScreenConfig> ScreenSettings { get; set; }
        
    
        #endregion

        #region Constructors / Destructor

        /// <summary>
        /// 
        /// </summary>
        public Config()
        {
            IsContextMenuHide = true;
            ScreenSettings = new List<ScreenConfig>();
            IsHiddenChart = false;
            IsBugUserStory = true;
            ShowBugInStoryAndTaskBoard = true;
            ConfigName = "Default Config";
            RankingMust = new Range(double.MinValue, 999);
            RankingShould = new Range(1000, 1999);
            RankingCould = new Range(2000, double.MaxValue);
            ControlSize = new Size(200, 120);
            ShowResizeButton = true;
            ShowCustomScrumMap = true;
        }

        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------

        #endregion

        #region Methods

        #endregion

        #region Events

        #endregion

    }
}
